package com.soccertgc.data.adapters
{
	import com.soccertgc.logging.LogOptions;

	public class LogOptionsAdapter
	{
		public static function fromXML(xml:XML):LogOptions
		{
			// Create new configurtion
			var options:LogOptions = new LogOptions();
			// Safe exec
			try
			{
				// Targets
				for each (var target:XML in xml.targets.target)
				{
					options.targets.push( LogTargetParamsAdapter.fromXML(target) );
				}
			}
			// Unexpected exception
			catch (e:Error)
			{
				throw new Error("LogOptionsAdapter.fromXML() unexpected error: " + e.toString());
			}
			return options;
		}
	}
}